package com.anyisn.anyflickr.shell.model
{
	import com.adobe.serialization.json.JSON;
	import com.anyisn.anyflickr.common.ApplicationConstants;
	import com.anyisn.anyflickr.shell.ShellFacade;
	import com.anyisn.anyflickr.shell.model.vo.TranslateVO;
	
	import mx.rpc.events.ResultEvent;
	import mx.rpc.http.HTTPService;
	
	import org.puremvc.as3.multicore.patterns.proxy.Proxy;
	
	public class GoogleServiceProxy extends Proxy
	{
		public static const NAME:String = 'GoogleServiceProxy';
		
		public function GoogleServiceProxy(data:Object=null)
		{
			super(NAME, data);
		}
		
		/*public function translate(transVO:TranslateVO):void {
			var service:HTTPService = new HTTPService();
			service.resultFormat = HTTPService.RESULT_FORMAT_E4X;
			service.url = ApplicationConstants.GOOGLE_TRANSLATE_URL_BASE + transVO.txt + '&langpair=' + transVO.lang_from + '%7C'+ transVO.lang_to;
			service.addEventListener(ResultEvent.RESULT, onTransResult);
			service.send();
		}
		
		private function onTransResult(e:ResultEvent):void {
			var re:* = com.adobe.serialization.json.JSON.decode(XML(e.result).toString());
			sendNotification(ShellFacade.GOOGLE_TRANSLATE_RESULT, re);
		}*/
	}
}